package vip.xiaonuo.api;


import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;
import vip.xiaonuo.dto.StartForMeDTO;
import vip.xiaonuo.dto.TaskDTO;
import vip.xiaonuo.dto.TaskProcessDTO;
import vip.xiaonuo.vo.*;

import java.util.List;

@FeignClient(name = "FlowableApi", url = "${api.url}")
public interface FlowableApi {
    /**
     * 查询我的代办
     */
    @PostMapping("/api/process/toDoList")
    TaskProcessDTO toDoList(@RequestBody TaskDTO taskDTO);

    /**
     * 启动流程
     */
    @PostMapping("/api/process/start")
    String start(@RequestBody StartVO startVO);

    /**
     * 同意流程
     */
    @PostMapping("/api/process/agree")
    void agree(@RequestBody AgreeVO agreeVO);

    /**
     * 拒绝
     */
    @PostMapping("/api/process/refuse")
    void refuse(@RequestBody RefuseVO refuseVO);

    /**
     * 撤销
     */
    @PostMapping("/api/process/revoke")
    void revoke(@RequestParam("instanceId") String instanceId, @RequestParam("userId") String userId);

}
